<?php

namespace App\Http\Requests\admin;

use App\Http\Requests\Request;

class UserRequest extends Request
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            //验证字段
        
            'name' => 'required',
            'pass' => 'required',
            'repass' => 'required|same:pass',
            'phone' => 'required',
            'email' => 'required|email',

        
        ];
    }

    public function messages(){
        return [
            'name.required'=>'账号不能为空',
            'pass.required'=>'密码不能为空',
            'repass.required'=>'重复密码不能为空',
            'repass.same'=>'两次密码输入不一致',
            'phone.required'=>'手机号码不能为空',
            // 'phone.digits_between'=>'手机号码格式不正确',
            'email.required'=>'邮箱不能为空',
            'email.email'=>'邮箱格式不正确',

        ];
    }
}
